﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.ServiceProcess;
using System.Text;
using Sherwood.Configuration;
using Sherwood.Content.UpdateScheduler;
using Microsoft.Practices.Unity;

namespace Sherwood.Samples.UpdateSchedulerService
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
#if DEBUG
            if (Debugger.IsAttached)
                DependencyInjection.Resolve<Scheduler>().RunNow();
            else
            {
                var servicesToRun = new ServiceBase[] { new UpdateSchedulerService() };
                ServiceBase.Run(servicesToRun);
            }
#else
            ServiceBase[] ServicesToRun;
            ServicesToRun = new ServiceBase[] 
			{ 
				new UpdateSchedulerService() 
			};
            ServiceBase.Run(ServicesToRun);
#endif
        }
    }
}
